<script>
  $(function(){
    $('#idEps').change(function(){
      $('#segmento').attr('style', 'display: none');
      
      url = '<?=$this->baseUrl?>/download/load-segmento-ajax/idEps/' + $(this).val();

      $('#listaSegmento').load(url);
    })
  })
  
  $(function(){
    $('#idEps').change(function(){
      $('#segmento').attr('style', 'display: none');
      
      url = '<?=$this->baseUrl?>/download/load-site-ajax/idEps/' + $(this).val();

      $('#listaSite').load(url);
    })
  })
  
  function load(url){
    location = url;
  }   
</script>

<script type="text/javascript">
    jQuery(function($){
      $("#data_filter").mask("99/99/9999");          
    });
</script>
    
<form name="form" action="" method="POST">
  <table align='center' border='0'>
    <?php 
      if($this->message != ""){
        ?>
        <tr>
          <td colspan="2" align="center" style="color: #FF0000"><?php echo $this->message?></td>
        </tr>
        <?php
      }
    ?>
    <tr>
      <td colspan="2" align="left">
        <input type="button" class="button" value="Filtros" style="vertical-align: sub;" disabled='disabled'>
      </td>
    </tr>
    
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0">
			    <tr>
			      <td>
			        <table class="table_form" border="0" width="100%" style="margin-top: -4px;">
			          <tr>
		              <td colspan="6">
		                <div><img alt="" src="<?php echo $this->baseUrl?>/imagens/spacer.gif" height="10" width="100%"> </div>
		              </td>
		            </tr>
		            
			          <tr>
			            <td align='right'>
			              <font color="#FF0000"><b>*</b></font>EPS: 
			            </td>
			            
			            <td>
			              <?php 
			                $value = $this->eps ? $this->eps[0]['idEps'] : '';
			                $label = $this->eps ? $this->eps[0]['ds_eps'] : 'Selecione';
			                
			                echo Zend_View_Helper_DbComboBox::dbComboBox('idEps', '', $this->modelEps, 'idEps', 'ds_eps', $value, $label, '', '');
			              ?>
			            </td>
			          
			            <td align='right'>
			              <font color="#FF0000"><b>*</b></font>Site: 
			            </td>
			            
			            <td><div id="listaSite"><?php echo $this->render('download/select-site-ajax.phtml')?></div></td>
			          
			            <td align='right'>
			              <font color="#FF0000"><b>*</b></font>Segmento: 
			            </td>
			            
			            <td><div id="listaSegmento"><?php echo $this->render('download/select-segmento-ajax.phtml')?></div></td>
			          </tr>
			          
			          <tr>
			            <td align="right"><font color="#FF0000"><b>*</b></font>Carteira:</td>
			            
			            <td><div id="listacarteira"><?php echo $this->render('download/select-carteira-ajax.phtml')?></div></td>
			              
			            <td align="right"><font color="#FF0000"><b>*</b></font>Cartão:</td>
			            
			            <td><div id="listasubsegmento"><?php echo $this->render('download/select-subsegmento-ajax.phtml')?></div></td>
			            
			            <td align="right"><font color="#FF0000"><b>*</b></font>Gravador:</td>
			            <td align="left">
			              <div id="showGravador">
			                <?php 
			                  //echo Zend_View_Helper_DbComboBox::dbComboBox('idGravador', '', $this->modelGravador, 'idGravador', 'ds_gravador', '', 'Selecione', '', '');
			                  echo $this->render('download/datafield-gravador-ajax.phtml');
			                ?>
			              </div>
			            </td>
			          </tr>
			          
			          <tr>
			            <td align="right"><font color="#FF0000"><b>*</b></font>Método de Baixa:</td>
			            <td align="left">
			              <div id="showMetodobaixa">
			                <?php 
			                  //echo Zend_View_Helper_DbComboBox::dbComboBox('idMetodo_baixa', '', $this->modelMetodoBaixa, 'idMetodo_baixa', 'ds_metodo_baixa', '', 'Selecione', '', '');
			                  echo $this->render('download/datafield-metodobaixa-ajax.phtml');
			                ?>
			              </div>  
			            </td>
			            
			            <td align="right"><font color="#FF0000"><b>*</b></font>Meta Mês:</td>
			            <td align="left">
			              <div id="showMetames">
			                <?php 
			                  //echo $this->metaMensal;
			                  echo $this->render('download/datafield-metasmes-ajax.phtml');
			                ?>
			              </div>  
			            </td>
			            
			            <td align="right"><font color="#FF0000"><b>*</b></font>Meta Dia:</td>
			            <td align="left">
			              <div id="showMetadia">
			                <?php 
			                  //echo $this->metaDiaria;
			                  echo $this->render('download/datafield-metasdia-ajax.phtml');
			                ?>
			              </div>
			            </td>
			          </tr>
			          
			          <tr>
			            <td align="right"><font color="#FF0000"><b>*</b></font>Acessos Simultâneos:</td>
			            <td align="left">
			              <div id="showAcessossimultaneos">
			                <?php 
			                  //echo Zend_View_Helper_DbComboBox::dbComboBox('idAcessos_simultaneos', '', $this->modelAcessosSimultaneos, 'idAcessos_simultaneos', 'nr_acessos_simultaneos', '', 'Selecione', '', '');
			                  echo $this->render('download/datafield-acessossimultaneos-ajax.phtml');
			                ?>
			              </div>
			            </td>
			            
			            <td align="right"><font color="#FF0000"><b>*</b></font>Previsão Venda:</td>
			            <td align="left">
			              <div id="showPrevisaovenda">
			                <?php 
			                  //echo Zend_View_Helper_DbComboBox::dbComboBox('idPrevisao_venda', '', $this->modelPrevisaoVenda, 'idPrevisao_venda', 'ds_previsao_venda', '', 'Selecione', '', '');
			                  echo $this->render('download/datafield-previsaovenda-ajax.phtml');
			                ?>
			              </div>
			            </td>
			            
			            <td align="right"><font color="#FF0000"><b>*</b></font>Quantidade Funcionarios:</td>
			            <td align="left">
			              <div id="showQuantidadefuncionarios">
			                <?php 
			                  //echo Zend_View_Helper_DbComboBox::dbComboBox('idQuantidadeFuncionarios', '', $this->modelQualtidadeFuncionarios, 'idQuantidadeFuncionarios', 'nr_quantidade_funcionarios', '', 'Selecione', '', '');
			                  echo $this->render('download/datafield-quantidadefuncionarios-ajax.phtml');
			                ?>
			              </div>
			            </td>
			          </tr>
			          
			          <tr>
			            <td align="right"><font color="#FF0000"><b>*</b></font>Data da Operação:</td>
			            <td align="left">
			              <input name="date" id="data_filter" size="20" readonly="readonly" class="text_field" value="<?php echo $this->date?>">
			            </td>
			            
			            <td align="right" nowrap="nowrap"><font color="#FF0000"><b>*</b></font>Data do Contato:</td>
                  <td align="left">
                    <input name="dt_pasta" id="dt_pasta" size="20" readonly="readonly" class="text_field" value="<?php echo $this->dt_pasta?>">
                  </td>
			            
			            <?php 
			              if($this->controllerName == 'update'){?>
			                <td align="right"><font color="#FF0000"><b>*</b></font>Operador:</td>
                      <td align="left">
	                      <div id="showOperador">
	                        <?php 
	                          //echo Zend_View_Helper_DbComboBox::dbComboBox('idQuantidadeFuncionarios', '', $this->modelQualtidadeFuncionarios, 'idQuantidadeFuncionarios', 'nr_quantidade_funcionarios', '', 'Selecione', '', '');
	                          echo $this->render('download/select-operador-ajax.phtml');
	                        ?>
	                      </div>
	                    </td>
	                    <?php 
			              }
			            ?>
			          </tr>
			          
			          <tr>
			            <td align="center" colspan="6">
			              <?php $label_btn = $this->post ? 'Redefinir Filtro' : 'Filtrar' ?>
			              <input type="button" class="button" value="<?php echo $label_btn?>" onclick="sendData(2);">
			              <input type="button" class="button" value="Limpar Filtro" onclick="sendData(1);">
			              <input type="hidden" name="salvar" value="1">
			            </td>
			          </tr>
			          
			          <tr>
                  <td colspan="6">
                    <div><img alt="" src="<?php echo $this->baseUrl?>/imagens/spacer.gif" height="10" width="100%"> </div>
                  </td>
                </tr>
			        </table>
			      </td>
			    </tr>  
			  </table>
			</td>
	  </tr>
  </table>
</form>